package com.evildog.workspace.system.application.convert;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.evildog.workspace.common.result.PagedResult;
import com.evildog.workspace.dependencies.mybatis.object.LinkIdDTO;
import com.evildog.workspace.system.application.bo.UserBO;
import com.evildog.workspace.system.application.bo.UserPageBO;
import com.evildog.workspace.system.application.dto.UserCreateDTO;
import com.evildog.workspace.system.application.dto.UserDTO;
import com.evildog.workspace.system.application.dto.UserPageDTO;
import com.evildog.workspace.system.application.dto.UserUpdatePassDTO;
import com.evildog.workspace.system.application.entity.User;
import com.evildog.workspace.system.application.entity.UserPageDO;
import com.evildog.workspace.system.application.model.*;
import com.evildog.workspace.system.application.vo.UserPageVO;
import com.evildog.workspace.system.application.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface UserConvert {

    UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);

    UserPageDTO convert(UserPageParam userPageParam);

    UserDTO convert(UserUpdateParam userUpdateParam);

    @Mapping(target = "isDeleted", ignore = true)
    User convert(UserDTO userDTO);

    UserPageDO convert(UserPageDTO userPageDTO);

    UserVO convert(UserBO userBO);

    UserBO convert(User user);

    @Mappings({})
    PagedResult<UserPageBO> convert(IPage<UserPageDO> page);

    PagedResult<UserPageVO> convert(PagedResult<UserPageBO> page);

    com.evildog.workspace.system.api.vo.UserVO convertFeignVO(UserBO userBO);

    @Mapping(target = "linkIds", source = "userGroupIds")
    LinkIdDTO convert(UserUpdateGroupParam userParam);

    UserCreateDTO convert(UserCreateParam userParam);

    UserUpdatePassDTO convert(UserUpdatePassParam userUpdateParam);
}